<?php $this->
load->view('admin_home/_header') ?>
<?php $this->load->view('message') ?>
<script tyep="text/javascript">
  $().ready(function(){
        $("#main_page_li").addClass("active"); 

        $('.selectpicker').selectpicker({});
        
        $("#module_add_form").validate({
            rules:{
                module_name:
                {
                    required:true,
                    maxlength:200
                },
                module_sort:
                {
                    required:true,
                    maxlength:200
                },
                big_lecture_id:
                {
                    required:true,
                },
                
            }
        });   
  });
</script>

<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">添加模块</h3>
        </div>
        <div class="panel-body">
            <?php echo validation_errors(); ?>
            <form id="module_add_form" method="post" class="form-horizontal"  enctype="multipart/form-data" action="<?php echo site_url('admin_module/add')?>
                " >
                <input type="text" id="module_type" name="module_type" value="0" class="hidden">
                <input type="int" id="big_lecture_id" name="big_lecture_id" value="<?=$big_lectures_selected?>" class="hidden">
                <fieldset>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">模块名称:</label>
                        <div class="col-lg-8">
                            <input class="form-control" id="module_name" name="module_name"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">模块序号:</label>
                        <div class="col-lg-8">
                            <input class="form-control" id="module_sort" name="module_sort"/>
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">考试时间:</label>
                        <div class="col-lg-8">
                            <select class="form-control" name="module_time_limit" id="module_time_limit">
                                <?php for($i=5; $i<=150 ;$i+=5) :?>
                                <option value="<?=$i?>" <?php if($i==30) echo "selected='true'"?>
                                    "">
                                    <?=$i?>分钟</option>
                                <?php endfor; ?></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">相关考点:</label>
                        <div class="col-lg-8">

                            <select class="selectpicker form-control" multiple data-live-search="true" data-style="btn-primary" multiple data-selected-text-format="count" name="relative_test_points[]">

                                <?php foreach ($test_points as $item ): ?>
                                <option value="<?=$item['id']?> 
                                    ">
                                    <?=$item['content']?></option>
                                <?php endforeach ?></select>

                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-10 col-lg-offset-2">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>

<?php $this->load->view('admin_home/_footer')?>